package com.qf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.pojo.DtsOrder;
import com.qf.pojo.DtsOrderGoods;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 订单商品表 Mapper 接口
 * </p>
 *
 * @author zhaojian
 * @since 2021-05-12
 */
public interface DtsOrderGoodsMapper extends BaseMapper<DtsOrderGoods> {

    @Select("SELECT DATE_FORMAT(add_time,'%Y-%m-%d') AS mobile,user_id,order_price " +
            "FROM dts_order WHERE order_status NOT IN (101,102,103) AND deleted = 0 AND " +
            "add_time > DATE_ADD(DATE_FORMAT(NOW(),'%Y-%m-%d'),INTERVAL #{day} DAY) ORDER BY add_time")
    List<DtsOrder> findOrderAndUser(int day);
}
